import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'vant/lib/index.css'
import 'virtual:windi.css'
import './assets/font/iconfont.css'
import './assets/style/global.scss'

import Vant, { Lazyload } from 'vant'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Cookies from 'js-cookie'

// const whiteList = ['/login', '/',] // 白名单
// router.beforeEach((to, from, next) => {
//   if (Cookies.get('user')) {
//     next()
//   }
//   if (whiteList.includes(to.path)) next()
//   if (to.path !== '/login') {
//     next({ path: '/login' })
//   } else {
//     console.log('ok')
//     next()
//   }
// })

createApp(App).use(router).use(Vant).use(ElementPlus).use(Lazyload).mount('#app')
